#ifndef __ML_PLAYER_H__
#define __ML_PLAYER_H__

#include "aircraft.h"
// adapter
template<typename GameObject, typename Function> 
std::function<void(SceneNode&, sf::Time)>
derivedAction(Function fn) {
	return [=](SceneNode& node, sf::Time dt) {
		assert(dynamic_cast<GameObject*>(&node) != nullptr);

		fn(static_cast<GameObject&>(node), dt);
	};
}

struct AircraftMover {
	AircraftMover(float vx, float vy)
		: velocity(vx, vy) {};
	void operator() (Aircraft& aircraft, sf::Time) const {
		aircraft.accelerate(velocity);
	}
	sf::Vector2f velocity;
};

class Player {
public :
	void handleEvent(const sf::Event& event, CommandQueue& commands);
	void handleRealtimeInput(CommandQueue& commands);
};

#endif